﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Resources;
using UIT.Utils;
using System.Reflection;
using UIT.Controls.Containers;
using UIT.Commands;
using UIT.VisualStates;

namespace UIT
{
    public class Application
    {
        public Application()
            : this(new CommandProcessor())
        {

        }

        public Application(CommandProcessor processor)
        {
            commandProcessor = processor;
        }

        public void OnStart()
        {
            if (Start != null)
                Start(this, EventArgs.Empty);
        }

        public void OnStop()
        {
            if (Stop != null)
                Stop(this, EventArgs.Empty);
        }

        public event EventHandler Start;
        public event EventHandler Stop;
        private CommandProcessor commandProcessor;

        public static Stream GetResourceStream(Uri target)
        {
            return Context.Current.GetStream(target);
        }


        public virtual IControlFinder ControlFinder { get { return new ControlFinder(); } }

        public virtual CommandProcessor CommandProcessor { get { return commandProcessor; } }
    }
}
